<?php
    session_start();
    require_once '../../rutas.php';
    require_once DB;
    require_once CLASES.'/user.php';

    extract($_POST);
    abrirConexion();
    $user=new User();
    if($user->comprobarSession($username, $password))
    {
        $user->cargarUser($username);
        $_SESSION['user']=$user;
        $_SESSION['session']=1;
        
        if($_SESSION['rol']=="Estudiante"){
            echo "Estudiante";
        }else{
            echo "Administrador";
        }
    }else{ 
        echo "false";
    }
?>
